#!/bin/bash
cd /app/cloud-microservices
git pull origin master

cd /app/cloud-microservices/cloud-microservices
mvn clean install -U

cp -f /app/cloud-microservices/cloud-gateway-startup/target/cloud-gateway-startup.jar /app/cloud-microservices/cloud-deploy
cp -f /app/cloud-microservices/cloud-auth-startup/target/cloud-auth-startup.jar /app/cloud-microservices/cloud-deploy
cp -f /app/cloud-microservices/cloud-admin-startup/target/cloud-admin-startup.jar /app/cloud-microservices/cloud-deploy
cp -f /app/cloud-microservices/cloud-tenant-startup/target/cloud-tenant-startup.jar /app/cloud-microservices/cloud-deploy
cp -f /app/cloud-microservices/cloud-member-startup/target/cloud-member-startup.jar /app/cloud-microservices/cloud-deploy

cd /app/cloud-microservices/cloud-deploy/standlone

docker-compose build gateway auth admin tenant member
docker-compose up -d gateway auth admin tenant member
